package day12.KeJian;

import java.io.File;
import java.io.IOException;

public class Test01 {
    public static void main(String[] args) throws IOException {
        //m1();
        //m2();
        //m3();
        //m4();
    }
    //public boolean   delete()删除由此抽象路径名表示的文件或目录
    private static void m4() {
        File file = new File("D://itheima//aa");
        boolean delete = file.delete();
        System.out.println(delete);
        File file1 = new File("D://itheima//xx.txt");
        boolean delete1 = file1.delete();
        System.out.println(delete1);
        System.out.println(delete1);
    }

    private static void m3() {
        for (int i = 1; i < 20; i++) {
            File file2 = new File("D://itheima//aa//bb");
            file2.mkdirs();

        }
    }
    //public boolean mkdirs()创建由此抽象路径名命名的目录，包括任何必需但不存在的父目录
    private static void m2() {
        File file1 = new File("D://itheima//cc");
        boolean mkdirs = file1.mkdirs();
        System.out.println(mkdirs);
    }
    //public boolean createNewFile()当具有该名称的文件不存在时，创建一个由该抽象路径名命名的新空文件
    private static void m1() throws IOException {
        File file = new File("D://itheima//aa.txt");
        boolean newFile = file.createNewFile();
        System.out.println(newFile);
    }
}
